home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
bbs_tee.zip
/
BBS_TEE.DOC
next >
Wrap
Text File
|
1987-06-10
|
4KB
|
93 lines
These are two quick files that add a micro-bbs to a Yam-Host operation.
bbs.c - I know it is filled with gotos and you don't like that, but I
was in a hurry and it works. Anyone wants to fix it or enhance
it just send me a copy!
bbs is a small signon/bbs program that maintains a simple users
database consisting of a 25 character name (plus a NULL) and a
10 character password (plus a NULL). The pasword is case-sensitive
and the name is forced to lowercase with uppercase first letters.
Also stored is a 2-byte count of the number of times that user has
signed on.
after challeng.t has accepted a name from the user call bbs like:
!~bbs %remote 0 0
%remote is the user's first AND last names as gathered by challeng.t
and may be in any case. The first 0 is a flag that says that this
user has not signed on yet. If the first 0 is a 1 then the password
gathering is skipped and the bbs program will skip to the micro-bbs
mail routines.
The second 0 indicates that there is a remote user involved. If the
second 0 is a 1 then the carrier checking and modem i/o are not done.
This allows you to run it locally with the command line:
bbs your name 0 1 or bbs your name 1 1
You may then read or send mail from your keyboard without being
on-line. If the mode is local (second 0 is 1) then you may read
all personal messages in the micro-bbs by entereing the letter 's'
at the menu prompt (even though 's' is not indicated in the menu).
If you are in the local mode then 'u' will prompt you as to whether
you want to delete each user as you go through the list.
As the file is set up now it assumes COM1 (change to COM2 by modifying
0x3f in carrier() to 0x2f. It also assumes a subdirectory to the
root directory called 'rem' for the users.bbs file and the msgs.bbs
file. These can be changed and then re-compiled. The existing
source is for MSC v4.+ ... changes to other compilers should only
involve the int86() calls that use the header dos.h and the REGS
union for doing bios interupts.
The msgs.bbs file consists of the name of the user that the message
is to and the number of the message. The number is converted to a
.msg filename (number 4 would be 00004.msg etc...) and the message
is saved or read as that file.
The first record of the users file contains the number of users (ie
records in the file!) and the record number of the last user. The
msgs.bbs file's first record consists of the next message number (for
that message's filename) and the number of messages (records) in the
msgs.bbs file. Both the users and the msgs first records are padded
to be the same length as the regular records in the file to allow for
the (very simple) random record routines.
tee.c - tee is a filter that may be used to redirect stdout to the screen and
the modem at the same time. It also does carrier checking (COM1 see
above about changing to COM2). Very simple stuff as it just gathers
stdout stuff and sends to stderr and the modem. I did add checking
after sending each character for ^S to pause, ^K, ^X & ^C to abort.
The check is made of both the local keyboard and the modem. The same
info re compiling under non-MSC v4.+ applies here as well as the
routine inkey() you will have to supply that one. inkey() just
checks the local keyboard and returns either NULL if nothing is there
or the character enetered if there is one waiting.
I use it to supply a .arc file directory (trapped in checkrmt.t) like
this:
!~pkxarc -v arcfn |tee
tee.c could be written to redirect i/o from stdout to stderr, a file,
the printer and the modem ... I am working on it!
I hope that you find these as useful as I have and would appreciate
hearing from anyone who has made any changes or improvements!
All the modem routines are based on ansiterm.c and used with thanks
in both bbs.c and tee.c.
06/10/87 - Simon J. Ewins, Voice: (416) 967-1255
2 Bloor St., West, Data: (416) 967-5745
#100-501,
Toronto, Ontario,
CANADA. M4W 3E2